SetAngleLimit
Sets the angle limit (in degrees) of the current motor port
Contents
Syntax
SetAngleLimit(limt)
Description
SetAngleLimit(limt) sets the angle limit in degrees for the current motor, which is set by function SetMotor. This setting takes only affect with the next SendMotorSettings command.
Use SetAngleLimit(0) to deactivate this limit (hence the motor will run forever).
Note:
This commmand provides an automatically limited motor rotation. The NXT Brick will try to rotate only to the angle which is set. Unfortunately if the power is set too high, the target angle will be slightly missed, as the motor has still enough angular momentum to keep spinning a bit. Ways around can be to slow down the motor before it approaches its angle limit and then keep going very carefully, or to willingly miss the angle limit and then reverse back to where you want to go precisely.
Example
SetMotor(MOTOR_B); SetPower(76); SetAngleLimit(720); SendMotorSettings();
See also
SendMotorSettings, SetMotor, GetMotor
Signature
- Author: Linus Atorf, Alexander Behrens (see AUTHORS)
- Date: 2007/10/15
- Copyright: 2007-2008, RWTH Aachen University